<template>
    <wv-tabbar>
        <wv-tabbar-item to="/device/near" :is-on="nearDevicesActive">
            <i class="iconfont iot-near" slot="icon"></i> 附近设备
        </wv-tabbar-item>

        <wv-tabbar-item to="/order/list" :is-on="orderActive">
            <i class="iconfont iot-order" slot="icon"></i> 订单列表
        </wv-tabbar-item>

        <wv-tabbar-item to="/user/profiles" :is-on="personActive">
            <i class="iconfont iot-person" slot="icon"></i> 个人中心
        </wv-tabbar-item>
    </wv-tabbar>
</template>

<script>
    export default {
        data () {
            return {

            }
        },

        computed: {
            homeActive: function () {
                if (this.$route.name == 'home') {
                    return true;
                }

                return false;
            },

            nearDevicesActive: function () {
                if (this.$route.name == 'near-devices') {
                    return true;
                }

                return false;
            },

            orderActive: function () {
                if (this.$route.name == 'order-list') {
                    return true;
                }

                return false;
            },

            personActive: function () {
                if (this.$route.name == 'user-profiles') {
                    return true;
                }

                return false;
            }
        }
    }
</script>